const rawToString = Object.prototype.toString;

export const toString = (target) => {
	return rawToString.call(target).slice(8, -1);
};

export const isFunction = (target) => {
	return toString(target) === 'Function';
};

export const isPromise = (target) => {
	return toString(target) === 'Promise';
};

export const isArray = (target) => {
	return toString(target) === 'Array';
};

export const isObject = (target) => {
	return toString(target) === 'Object';
};

export const isNumber = (target) => {
	return toString(target) === 'Number';
};

export const isString = (target) => {
	return toString(target) === 'String';
};

export const isUndef = (target) => {
	return target === '' || target === null || target === undefined;
};

export const isElement = (target) => {
	return target instanceof HTMLElement;
};
